import { doRequest } from './help/request-use-axios';

export const testApi = (data = {}): RequestReturnType => {
    return doRequest({
        apiItem: {
            path: '/testApi',
            useMock: true,
        },
        data,
    });
};

export const login = (data = {}): RequestReturnType => {
    return doRequest({
        apiItem: {
            path: '/login',
            useMock: true,
            errMsg: {
                17011: '用户名密码错误',
            },
        },
        data,
    });
};

export const getUserBaseInfo = (data = {}): RequestReturnType => {
    return doRequest({
        apiItem: {
            useMock: true,
            path: '/baseInfo',
        },
        data,
    });
};

export const captcha = (data = {}): RequestReturnType => {
    return doRequest({
        apiItem: {
            useMock: true,
            path: '/captcha',
        },
        data,
    });
};

export const rabiaFirstLogin = (data = {}): RequestReturnType => doRequest({ apiItem: { path: '/api/rabia-test/login-first-step' }, data });

export const rabiaLogin = (data = {}): RequestReturnType => doRequest({ apiItem: { path: '/api/rabia-test/login' }, data });

export const rabiaGetAccountBaseInfo = (data = {}): RequestReturnType => doRequest({ apiItem: { path: '/api/rabia-test/rabia/account/baseInfo' }, data: data, method: 'get' });

//测试幂等接口

export const testGet4 = (data = {}): RequestReturnType => {
    return doRequest({
        apiItem: {
            path: '/api/v1/demo1-service/order/get4',
        },
        method: 'get',
        data,
    });
};

export const testGet5 = (data = {}): RequestReturnType => {
    return doRequest({
        apiItem: {
            path: '/api/v1/demo1-service/order/get5',
        },
        method: 'post',
        data,
    });
};

export const testName = (data = {}): RequestReturnType => {
    return doRequest({
        apiItem: {
            path: '/api/v1/demo1-service/name/test1',
        },
        method: 'get',
        data,
    });
};
